.class Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;
.super Ljavax/microedition/lcdui/ImageStringItem;
.source "ChoiceGroup.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Ljavax/microedition/lcdui/ChoiceGroup;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "ChoiceItem"
.end annotation


# instance fields
.field box:Ljavax/microedition/lcdui/Image;

.field private font:Ljavax/microedition/lcdui/Font;

.field private selected:Z

.field private final this$0:Ljavax/microedition/lcdui/ChoiceGroup;


# direct methods
.method constructor <init>(Ljavax/microedition/lcdui/ChoiceGroup;Ljava/lang/String;Ljavax/microedition/lcdui/Image;Ljava/lang/String;)V
    .locals 1
    .parameter
    .parameter "label"
    .parameter "image"
    .parameter "text"

    .prologue
    .line 669
    iput-object p1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->this$0:Ljavax/microedition/lcdui/ChoiceGroup;

    .line 670
    invoke-direct {p0, p2, p3, p4}, Ljavax/microedition/lcdui/ImageStringItem;-><init>(Ljava/lang/String;Ljavax/microedition/lcdui/Image;Ljava/lang/String;)V

    .line 671
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->setSelectedState(Z)V

    .line 672
    invoke-static {}, Ljavax/microedition/lcdui/Font;->getDefaultFont()Ljavax/microedition/lcdui/Font;

    move-result-object v0

    iput-object v0, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->font:Ljavax/microedition/lcdui/Font;

    .line 673
    return-void
.end method


# virtual methods
.method getFont()Ljavax/microedition/lcdui/Font;
    .locals 1

    .prologue
    .line 676
    iget-object v0, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->font:Ljavax/microedition/lcdui/Font;

    return-object v0
.end method

.method getHeight()I
    .locals 2

    .prologue
    .line 692
    const/4 v0, 0x0

    .line 693
    .local v0, height:I
    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    if-eqz v1, :cond_0

    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v1}, Ljavax/microedition/lcdui/Image;->getHeight()I

    move-result v0

    .line 694
    :cond_0
    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    if-eqz v1, :cond_1

    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v1}, Ljavax/microedition/lcdui/Image;->getHeight()I

    move-result v1

    if-le v1, v0, :cond_1

    .line 695
    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v1}, Ljavax/microedition/lcdui/Image;->getHeight()I

    move-result v0

    .line 697
    .restart local v0       #height:I
    :cond_1
    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->stringComponent:Ljavax/microedition/lcdui/StringComponent;

    invoke-virtual {v1}, Ljavax/microedition/lcdui/StringComponent;->getHeight()I

    move-result v1

    if-le v1, v0, :cond_2

    .line 698
    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->stringComponent:Ljavax/microedition/lcdui/StringComponent;

    invoke-virtual {v1}, Ljavax/microedition/lcdui/StringComponent;->getHeight()I

    move-result v0

    .line 700
    .restart local v0       #height:I
    :cond_2
    return v0
.end method

.method isSelected()Z
    .locals 1

    .prologue
    .line 742
    iget-boolean v0, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->selected:Z

    return v0
.end method

.method paint(Ljavax/microedition/lcdui/Graphics;)I
    .locals 5
    .parameter "g"

    .prologue
    const/16 v4, 0x14

    const/4 v3, 0x0

    .line 705
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->stringComponent:Ljavax/microedition/lcdui/StringComponent;

    if-nez v2, :cond_0

    move v2, v3

    .line 735
    :goto_0
    return v2

    .line 709
    :cond_0
    const/4 v0, 0x0

    .line 710
    .local v0, widthAddition:I
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    if-eqz v2, :cond_1

    .line 711
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    invoke-virtual {p1, v2, v3, v3, v4}, Ljavax/microedition/lcdui/Graphics;->drawImage(Ljavax/microedition/lcdui/Image;III)V

    .line 712
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    if-eqz v2, :cond_4

    .line 713
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v2}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v0

    .line 714
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v2}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v2

    invoke-virtual {p1, v2, v3}, Ljavax/microedition/lcdui/Graphics;->translate(II)V

    .line 723
    :cond_1
    :goto_1
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    if-eqz v2, :cond_2

    .line 724
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v2}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v2

    add-int/lit8 v2, v2, 0x2

    add-int/2addr v0, v2

    .line 725
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    invoke-virtual {p1, v2, v3, v3, v4}, Ljavax/microedition/lcdui/Graphics;->drawImage(Ljavax/microedition/lcdui/Image;III)V

    .line 726
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v2}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v2

    add-int/lit8 v2, v2, 0x2

    invoke-virtual {p1, v2, v3}, Ljavax/microedition/lcdui/Graphics;->translate(II)V

    .line 729
    :cond_2
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->stringComponent:Ljavax/microedition/lcdui/StringComponent;

    invoke-virtual {v2, p1}, Ljavax/microedition/lcdui/StringComponent;->paint(Ljavax/microedition/lcdui/Graphics;)I

    move-result v1

    .line 731
    .local v1, y:I
    if-eqz v0, :cond_3

    .line 732
    neg-int v2, v0

    invoke-virtual {p1, v2, v3}, Ljavax/microedition/lcdui/Graphics;->translate(II)V

    :cond_3
    move v2, v1

    .line 735
    goto :goto_0

    .line 717
    .end local v1           #y:I
    :cond_4
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v2}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v2

    add-int/lit8 v0, v2, 0x2

    .line 718
    iget-object v2, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v2}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v2

    add-int/lit8 v2, v2, 0x2

    invoke-virtual {p1, v2, v3}, Ljavax/microedition/lcdui/Graphics;->translate(II)V

    goto :goto_1
.end method

.method setFont(Ljavax/microedition/lcdui/Font;)V
    .locals 2
    .parameter "f"

    .prologue
    .line 746
    if-nez p1, :cond_0

    .line 747
    new-instance v0, Ljava/lang/NullPointerException;

    invoke-direct {v0}, Ljava/lang/NullPointerException;-><init>()V

    throw v0

    .line 750
    :cond_0
    invoke-virtual {p1}, Ljavax/microedition/lcdui/Font;->getHeight()I

    move-result v0

    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->font:Ljavax/microedition/lcdui/Font;

    invoke-virtual {v1}, Ljavax/microedition/lcdui/Font;->getHeight()I

    move-result v1

    if-ne v0, v1, :cond_1

    .line 751
    iput-object p1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->font:Ljavax/microedition/lcdui/Font;

    .line 752
    :cond_1
    return-void
.end method

.method public setImage(Ljavax/microedition/lcdui/Image;)V
    .locals 2
    .parameter "img"

    .prologue
    .line 681
    iput-object p1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    .line 683
    const/4 v0, 0x0

    .line 684
    .local v0, width:I
    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    if-eqz v1, :cond_0

    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    invoke-virtual {v1}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v1

    add-int/2addr v0, v1

    .line 685
    :cond_0
    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->img:Ljavax/microedition/lcdui/Image;

    if-eqz v1, :cond_1

    invoke-virtual {p1}, Ljavax/microedition/lcdui/Image;->getWidth()I

    move-result v1

    add-int/2addr v0, v1

    .line 686
    :cond_1
    if-lez v0, :cond_2

    add-int/lit8 v0, v0, 0x2

    .line 687
    :cond_2
    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->stringComponent:Ljavax/microedition/lcdui/StringComponent;

    invoke-virtual {v1, v0}, Ljavax/microedition/lcdui/StringComponent;->setWidthDecreaser(I)V

    .line 688
    return-void
.end method

.method setSelectedState(Z)V
    .locals 2
    .parameter "state"

    .prologue
    .line 756
    iput-boolean p1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->selected:Z

    .line 758
    iget-object v0, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->this$0:Ljavax/microedition/lcdui/ChoiceGroup;

    iget v0, v0, Ljavax/microedition/lcdui/ChoiceGroup;->choiceType:I

    const/4 v1, 0x3

    if-eq v0, v1, :cond_0

    iget-object v0, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->this$0:Ljavax/microedition/lcdui/ChoiceGroup;

    iget v0, v0, Ljavax/microedition/lcdui/ChoiceGroup;->choiceType:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 759
    const/4 v0, 0x1

    iget-object v1, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->this$0:Ljavax/microedition/lcdui/ChoiceGroup;

    iget v1, v1, Ljavax/microedition/lcdui/ChoiceGroup;->choiceType:I

    if-ne v0, v1, :cond_2

    if-eqz p1, :cond_1

    invoke-static {}, Ljavax/microedition/lcdui/ChoiceGroup;->access$000()Ljavax/microedition/lcdui/Image;

    move-result-object v0

    :goto_0
    iput-object v0, p0, Ljavax/microedition/lcdui/ChoiceGroup$ChoiceItem;->box:Ljavax/microedition/lcdui/Image;

    .line 762
    :cond_0
    return-void

    .line 759
    :cond_1
    invoke-static {}, Ljavax/microedition/lcdui/ChoiceGroup;->access$100()Ljavax/microedition/lcdui/Image;

    move-result-object v0

    goto :goto_0

    :cond_2
    if-eqz p1, :cond_3

    invoke-static {}, Ljavax/microedition/lcdui/ChoiceGroup;->access$200()Ljavax/microedition/lcdui/Image;

    move-result-object v0

    goto :goto_0

    :cond_3
    invoke-static {}, Ljavax/microedition/lcdui/ChoiceGroup;->access$300()Ljavax/microedition/lcdui/Image;

    move-result-object v0

    goto :goto_0
.end method
